/**
 * 
 */
package vn.edu.ctu.cit.se.android.karfinder;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

/**
 * @author Val
 *
 */
public class FavoriteActivity extends Activity {
	private SongListView listView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_favorite);
		listView = new SongListView(this, R.id.lvFavoriteList);
		fetchFavoriteList();
	}
/*
	@Override
	protected void onRestart() {
		Log.i("favorite", "onRestart");
		super.onRestart();
		fetchFavoriteList();
	} */

	@Override
	protected void onResume() {
		Log.i("favorite", "onResume");
		super.onResume();
		fetchFavoriteList();
	}

	private void fetchFavoriteList() {
		listView.setQuery("select SONG_ID, SONG_TITLE, SONG_LYRICS " +
				  "from SONG where SONG_IS_FAVORITE = 1");
	}
}
